package com.molichuxing.job;

import com.molichuxing.service.CarMaintenanceMileageJobService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.JobHandler;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 保养数据(里程) 定时任务
 * @author liyg
 *
 */
@JobHandler(value="vehicleMaintenanceMileageHandler")
@Component
public class VehicleMaintenanceMileageHandler extends IJobHandler{

	private static final Logger log = Logger.getLogger(VehicleMaintenanceMileageHandler.class);
    @Resource
    private CarMaintenanceMileageJobService carMaintenanceMileageJobService;


    public VehicleMaintenanceMileageHandler() {
		super();
	}

	@Override
    public void init() {
        super.init();
    }

    @Override
    public void destroy() {
        super.destroy();
    }

    @Override
    public ReturnT<String> execute(String s) throws Exception {
        ReturnT<String> returnT = ReturnT.SUCCESS;
        log.info("==============================保养数据(里程)   开始定时任务");
        Boolean result = carMaintenanceMileageJobService.getCarMaintenanceMileageHandler();
        log.info("==============================保养数据查询(里程)  结束定时任务result：");
        returnT.setContent("保养数据查询(里程) 定时任务的任务结果result："+ result);
        return returnT;
    }

}
